/**
 * 
 */
package com.cplsystems.incidencias.dao.impl;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.cplsystems.incidencias.business.Persona;
import com.cplsystems.incidencias.dao.PersonaDAO;

@Repository
public class PersonaDAOImpl extends HibernateDaoSupport implements PersonaDAO {

	@Autowired
	public void init(final SessionFactory sessionFactory)
			throws DataAccessException {
		setSessionFactory(sessionFactory);
	}

	@Transactional
	public void save(Persona persona) {
		getHibernateTemplate().saveOrUpdate(persona);
	}

}
